package com.jh.user.pojo.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * 畅捷支持银行
 */
public enum ChanBank {
    BUSINESS_TRAVEL("1", "商旅通道支持银行"),
    NEW_CARD("2", "新无卡通道支持银行"),
    ;
    private String value;
    private String desc;
    ChanBank(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static <T extends String> ChanBank of(T n) {
        String val;
        val = n;
        if (StringUtils.isEmpty(val)) {
            return null;
        }
        for (ChanBank bank : values()) {
            if (bank.getValue().equals(val)) {
                return bank;
            }
            if (bank.getDesc().equals(val)) {
                return bank;
            }
        }
        return null;
    }
}
